{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "e5b07f93",
   "metadata": {},
   "source": [
    "# 布尔值\n",
    "\n",
    "布尔变量（`bool`）的取值：布尔字面值常量。布尔字面值常量的取值为 `true` （整型值为 `1`） 和 `false` （整型值为 `0`）。\n",
    "\n",
    "布尔变量常用于表示逻辑运算的结果。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "db14ba16",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "false"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "int a {20};\n",
    "int b {30};\n",
    "bool c {a == b};\n",
    "c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "68de10e1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "true"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b = 20;\n",
    "bool c1 {a == b};\n",
    "c1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "94755fc0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "true"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "true"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "a5bff01a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "false"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "false"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "28e8e0a1",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "C++11",
   "language": "C++11",
   "name": "python3100jvsc74a57bd0a2954483fe4136a94bd721da8601251ae4c667fedb6adcfe70ff0183b19bacbc"
  },
  "language_info": {
   "codemirror_mode": "text/x-c++src",
   "file_extension": ".cpp",
   "mimetype": "text/x-c++src",
   "name": "c++",
   "version": "11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
